#@layout()

#define css()

<!--全局样式-->
<style type="text/css">
    div {
        background-image: url(http://47.105.208.60:8080/wechat-api/images/loginbg.png);
        background-position: center center;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-size: cover;
    }

</style>
#end

#define script()

<script>

    $.ajax({
        type: "get",
        url: "http://47.105.208.60:8080/wechat-api/category/findById?id=#(id ??)",
        //url: "http://localhost:8080/wechat-api/category/findById?id=#(id ??)",
        dataType: "json",
        success: function (data) {
            if (data.code == 0) {
                var msg = data.info;
                $("#id").val(msg.id);
                $("#title").val(msg.title);
                $("#content").val(msg.content);
            } else {
                alert(data.info);
            }
        },
        error: function (data) {
            alert(data.code);
        }
    })

    $("form").submit(function () {
        $.ajax({
            type: "post",
            url: "http://47.105.208.60:8080/wechat-api/category/updateGame",
            //url: "http://localhost:8080/wechat-api/category/updateGame",
            data: $("form").serialize(),
            dataType: "json",
            success: function (data) {
                if (data.code == 0) {
                    alert("成功");
                    window.location.href = "#(CPATH)/admin/shoot/index"
                } else {
                    alert(data.info);
                }
            },
            error: function (data) {
                alert(data.code);
            }
        })
    })

</script>

#end

#define content()
<div id="aaa" class="content-wrapper">
    <div style="margin-top: 100px; margin-left: 400px; background-color: #92B8B1">
        <table>
            <form onsubmit="return false">
                <input id="id" type="hidden" name="id" value="#(id ??)">
                <div style="padding-bottom: 50px">
                    <tr>
                        <td>赛事名称：</td>
                        <td><input type="text" id="title" name="title" placeholder="请输入赛事名称"/>
                        </td>
                    </tr>
                </div>
                <div style="padding-bottom: 50px">
                    <tr>
                        <td>赛事说明：</td>
                        <td><textarea id="content" name="content" rows='3' cols='30'></textarea></td>
                    </tr>
                </div>
                <div>
                    <tr>
                        <td></td>
                        <td><input type="submit" value="修改"/></td>
                    </tr>
                </div>
            </form>
        </table>
    </div>
</div>
#end

